'use strict';
/**
 * @name: 淘宝Top接口 方法初始化
 * @description: 根据不同的环境进行封装
 * @version: 0.0.1
 * @author: xiech
 * @Date: 2020-12-10 10:23:41
 * @LastEditors: xiech
 * @LastEditTime: 2020-12-10 10:23:42
 */

const node_taobaotop = require('./node_taobaotop.js');
const mini_taobaotop = require('./mini_taobaotop.js');
// const egg_mongodb = require('./egg_mongodb.js');

// 初始化淘宝的Top接口
const inittaobaotop = async ctx => {
  if (!ctx.mfutil) ctx.mfutil = {};
  if (!ctx.mfutil.requset) ctx.mfutil.requset = {};
  let taobaotop;

  if (ctx.env === 'node') {
    taobaotop = await node_taobaotop(ctx);
  } else if (ctx.env === 'egg') {

  } else {
    taobaotop = await mini_taobaotop(ctx);
  }
  ctx.mfutil.requset.taobaoTop = taobaotop;
}

module.exports = {
  initTaobaoTop: inittaobaotop,
};